<?php

use yii\helpers\Html;
use yii\grid\GridView;
use app\models\ClassroomuseSearchForPerson;

/* @var $this yii\web\View */
/* @var $searchModel app\models\ClassroomuseSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '教室使用';
$this->params['breadcrumbs'][] = $this->title;
?>
<?php    
    $searchModel = new ClassroomuseSearchForPerson($stuid);
    $dataProvider = $searchModel->search(\Yii::$app->request->queryParams); 
 ?>



<div class="classroomuse-model-index">

   
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a('选择', ['choose'], ['class' => 'btn btn-success']) ?>
    </p>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

//             'id',
             'stu_id',
             'stu_name',
            'title',
            'classroom',
            'telephone',
            'time',
        	'moment',
            'approved',
            'feedbacked',
            'remark',

        		[
        		'class' => 'yii\grid\ActionColumn',
        		'header' => '操作',
        		'template' => '{update}',
        		'buttons' =>
        		[
        				'update' => function ($url,$model, $key) {
        				return $model->approved=='审批中'?Html::a('<button>修改</button> ', '/bnews/web/apply/classroomupdate?id='.$model->id,['title' => '修改'] ):'';
        				},
        		
        				],
        				'headerOptions' => ['width' => '80'],
        		
        		],
        ],
    ]); ?>
</div>
